﻿using Common;
using DAL.Organization;
using Model.Organization;
using Model.Sys;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BLL.Organization
{
    public class EnterpriseBLL
    {
        EnterpriseDAL dal = new EnterpriseDAL();
        /// <summary>
        /// 获取所有的数据信息
        /// 根据条件
        /// </summary>
        /// <returns></returns>
        public List<EnterpriseModel> GetList(string strWhere, string term)
        {
            return dal.GetList(strWhere, term);
        }
        /// <summary>
        /// 主键编号获得对应实体类信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public EnterpriseModel GetModel(int id)
        {
            return dal.GetModel(id);
        }

        /// <summary>
        /// 保存数据
        /// </summary>
        /// <param name="productModel"></param>
        /// <returns></returns>
        public ResultEntity SaveData(EnterpriseModel model, SysUserModel userModel)
        {
            return dal.SaveData(model, userModel);
        }
        public string GetEnterpriseCode()
        {
            return dal.GetEnterpriseCode();
        }
        public EnterpriseModel GetModelByCode(int Code)
        {
            return dal.GetModelByCode(Code);
        }
        public List<EnterpriseModel> GetSonEnterprise(int enterpriseId)
        {
            return dal.GetSonEnterprise(enterpriseId);

        }
        public List<EnterpriseModel> GetALLButNoSelf(int enterpriseId)
        {

            return dal.GetALLButNoSelf(enterpriseId);
        }
    }
}
